package com.hj545.pl.bean;

import lombok.Data;

import java.io.Serializable;

/**
 * config
 * @author huangjian
 * @date 2018-02-16
 */
@Data
public class ConfVO implements Serializable {

	private static final long serialVersionUID = -4784569402272369464L;

	private String url;
	private String username;
	private String password;

	private String ip;
	private String port;
	private String dbname;

	private String filePath;
	private String confFilePath;

	private String projectName;
	private String evnName;
	private String pcName = System.getenv().get("COMPUTERNAME");

	private String className;
	private String classPath;

	private final static String CLASS_FIX = "com.hj545.pl.service.impl.";

	/**
	 * loading use
	 */
	public ConfVO(String ip, String port, String dbname, String username,
	              String password, String projectName, String evnName,
	              String filePath, String className, String confFilePath) {
		this.username = username;
		this.password = password;
		this.ip = ip;
		this.port = port;
		this.dbname = dbname;
		this.filePath = filePath;
		this.projectName = projectName;
		this.evnName = evnName;
		this.className = className;
		this.classPath = CLASS_FIX + className;
		this.confFilePath = confFilePath;
	}

	/**
	 * loading use
	 */
	public ConfVO(String ip, String port, String dbname, String username,
	              String password, String projectName, String evnName,
	              String filePath, String className) {
		this.username = username;
		this.password = password;
		this.ip = ip;
		this.port = port;
		this.dbname = dbname;
		this.filePath = filePath;
		this.projectName = projectName;
		this.evnName = evnName;
		this.className = className;
		this.classPath = CLASS_FIX + className;
	}

	/**
	 * backup use
	 */
	public ConfVO(String ip, String port, String dbname, String username, String
			password, String projectName, String confFilePath) {
		this.username = username;
		this.password = password;
		this.ip = ip;
		this.port = port;
		this.dbname = dbname;
		this.projectName = projectName;
		this.confFilePath = confFilePath;
	}
}
